﻿using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Windows.Forms;


namespace GUI
{
//    delegate void DoubleClickDelegate(DataGrid Grid, MouseEventArgs e);

    public class GridDelegate
    {
//        private Collection<DoubleClickDelegate> TxtKeyDownEvent = new Collection<DoubleClickDelegate>();
//        private Collection<DataGrid> CtrlGrid = new Collection<DataGrid>();

//        public GridDelegate()
//        {
//            this.OnKeyDown += delegate(TextBox txtControl, KeyEventArgs e)
//            {
//                if (e.KeyCode == Keys.Delete)
//                    e.Handled = true;
//            };
//        }
        
//        event DoubleClickDelegate OnKeyDown
//        {
//            add
//            {
//                TxtKeyDownEvent.Add(value);
//                foreach (TextBox txtControl in CtrlGrid)
//                    txtControl.TextChanged += KeyDown;
//            }
//            remove
//            {
//                TxtKeyDownEvent.Remove(value);
//                foreach (TextBox txtControl in CtrlGrid)
//                    txtControl.TextChanged -= KeyDown;
//            }
//        }

//        void KeyDown(object sender, EventArgs e)
//        {
//            TextBox txtControl = (TextBox)sender;
//            KeyEventArgs args = (KeyEventArgs)e;
//            foreach (DoubleClickDelegate d in TxtKeyDownEvent)
//                d.Invoke(txtControl, args);
//        }

        public void Function(DataGrid Grid, TextBox txtControl)
        {
            //Grid.MouseDoubleClick += txtControl
            //txtControl.KeyDown += KeyDown;
        }
   }
}
